package cn.aj.org.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.aj.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author aj
 * @since 2022-11-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Shop extends BaseDomain{

    private static final long serialVersionUID = 1L;

    @Excel(name="店铺名称", orderNum = "1", width = 30, isImportField = "true_st")
    private String name;
    @Excel(name="店铺电话", orderNum = "2", width = 30, isImportField = "true_st")
    private String tel;
    @Excel(name="创建时间", orderNum = "3", width = 30, isImportField = "true_st", format = "yyyy-MM-dd")
    // 后端返回时间格式给前端
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT + 8")
    // 前端返回时间格式给后端
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date registerTime = new Date();
    /**
     * 店铺状态：0待审核，1待激活，2驳回，3激活
     */
    @Excel(name="店铺状态", replace = {"待审核_0","1待激活_1","驳回_2","已激活_3"}, orderNum = "4", width = 30, isImportField = "true_st")
    private Integer state = 0;
    @Excel(name="店铺地址", orderNum = "5", width = 30, isImportField = "true_st")
    private String address;
    @Excel(name="店铺Logo", orderNum = "6", width = 30, isImportField = "true_st")
    private String logo;
    @Excel(name="管理员", orderNum = "7", width = 30, isImportField = "true_st")
    private Long adminId;
    // 封装员工的admin,必须是这个字段,否者接不到
    private Employee admin;
    // 店长展示
    private Employee employee;
    // 日志展示
    private List<ShopAuditLog> auditLogs;
}
